<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
  <head>    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<script type="text/javascript">
      function on_dept2_selected(node){
    	  $('#deptno').text(node.id);
    	  $('#workno').focus();
      }
	  function on_doc_ready()
	  {
	  	set_input_keydown_event();
	    $.extend($.fn.validatebox.defaults.rules, 
	    	{date:{message:'日期格式:YYYY-MM-DD',validator:validdate}});
	  	$('#result_code').combobox();
		$('#result_code').combobox('loadData', [{id:'',text:'所有'},{id:'0',text:'成功'},{id:'1',text:'失败'}]);
	    $('#query_log_panel').panel({onOpen:function(){
     		$('#result_code').combobox('select', '');
	    }});	    
	  	$('#enddate').datebox({formatter:date_formater});
	  	$('#startdate').datebox({formatter:date_formater});
    	$('#startdate').keydown(function(e){
    		if (e.keyCode==13 || e.keyCode==9)
    			$(this).datebox('close');
    	});
    	$('#enddate').keydown(function(e){
    		if (e.keyCode==13 || e.keyCode==9)
    			$(this).datebox('close');
    	});
     	$('#selectdept').click(function (){
     	  $('#sel_dept_win').window('open');
    	});
    	combobox_keypress('#result_code', '#startdate');    	
    	$('#query').click(query);
	  }
	  	  
	  function query()
	  {
	    var obj = {deptno:$('#deptno').text(),
	    	workno:$('#workno').val(),name:$('#name').val(),
	    	result_code:$('#result_code').combobox('getValue'),
	    	startdate:$('#startdate').val(),enddate:$('#enddate').val()};
	    try{
	      $('#log_table').datagrid('load', obj);
	    }
	    catch (e){
	    	var fields = [
	      		{field:'flagname',title:'交易类型',width:50,align:'center'},
	      		{field:'transno',title:'交易码',width:50,align:'center'},
	      		{field:'sysno',title:'系统号',width:40,align:'center'},
	      		{field:'deptno',title:'机构号',width:50,align:'center'},
	     		{field:'workno',title:'账户号',width:50,align:'center'},
	     		{field:'identifyno',title:'身份证号',width:100,align:'center'},
	      		{field:'name',title:'姓名',width:50,align:'center'},
	      		{field:'resultName',title:'验证结果',width:50,align:'center'},
	      		{field:'opterm',title:'操作终端',width:80,align:'center'},
	      		{field:'opdate',title:'操作日期',width:50,align:'center'},
	      		{field:'optime',title:'操作时间',width:50,align:'center'}
	    	];
	    
	    	$('#log_table').datagrid({pageSize:12,pageList:[12],columns:[fields],
	    		url:'QueryVerifyLog.action',queryParams:obj,pagination:true,
	    		striped:'true',onLoadError:on_load_error});
	    	var pager=$('#log_table').datagrid('getPager');
	    	pager.pagination({showPageList:false});
	    }
	  }
	  
	  jQuery(document).ready(on_doc_ready);
	</script>
  </head>
  <body>
    <s:include value="../selectdept.jsp"></s:include>
    <div id="query_log_panel" title="比对日志查询" fit="true" iconCls="icon-save" 
    	closable="true" class="jquery_panel">
    <table width="100%" height="100%">
    	<tr>
    		<td height="60px">
  				<s:form action="QueryVerifyLog" cssStyle="padding:0;margin:0;" id="query_form" theme="simple">
				  	<table width="700px">
				  		<tr>
  							<td><label>查询机构:</label><label id="deptno"  
  								style="width:60px;height:18px" class="text_field_css"></label>
    							<label style="width:1px"></label>
    							<button id="selectdept" class="buttons_css" style="width:80px">
    							<label style="80px" class="infoclass">选择机构</label></button></td>
				  			<td ><s:label for="workno" value="账户编号:"/><input id="workno" 
				  				maxlength=<s:property value="%{getText('CLERK_WORKNO_LEN')}"/> 
				  				class="text_field_css" style="width:90px"></input></td>
				  			<td ><s:label for="name" value="账户姓名:" /><input id="name" 
				  				maxlength=<s:property value="%{getText('NAME_LEN')}"/> 
				  				class="text_field_css" style="width:150px"></input></td>
				  			<td ></td>				  			
  						</tr>
				  		<tr>				  		
				  			<td ><s:label value="比对结果:" /><s:textfield id="result_code" editable="false"
				  				valueField="id" textField="text" cssStyle="width:143px" panelHeight="auto"/></td>
				  			<td><s:label for="startdate" value="开始日期:"/><input class="text_field_css" 
				  				id="startdate" maxlength=10 validType="date" style="width:90px"></input></td>
  							<td><s:label for="enddate" value="结束日期:"/><input class="text_field_css" 
  								id="enddate" maxlength=10 validType="date" style="width:90px"></input>
  								<label style="width:1px"></label>
  								<button id="query" class="buttons_css" style="width:60px">
  									<label style="70px" class="infoclass">查询</label></button></td>
  						</tr>
  					</table>
  				</s:form>
    		</td>
    	</tr>
    	<tr>
    		<td width="100%">
				<table id="log_table" title="账户比对日志" singleSelect="true" fit="true"
					fitColumns="true" style="background-color:white;"></table>
    		</td>
    	</tr>
    </table>
    </div>
  </body>
</html>
